<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class ShopGoodsSpecs extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
      Schema::create('shop_goods_specs', function (Blueprint $table) {
          $table->increments('id');
          $table->Integer('goods_id')->unsigned();   // 商品id
          $table->string('goods_desc', 100);          // 商品描述
          $table->text('goods_content');               // 商品介绍
          $table->timestamps();

          $table->foreign('goods_id')
              ->references('id')->on('shop_goods')
              ->onDelete('cascade');
      });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_goods_specs');
    }
}
